//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Components;
using CommunityServer.Components;
using CommunityServer.ControlPanel.UI;
using CommunityServer.ControlPanel.Controls;
using CommunityServer.ControlPanel.Components;
using CA = ComponentArt.Web.UI;

namespace CommunityServer.ControlPanel.BlogAdmin
{
	/// <summary>
	///		Summary description for DefaultPermissionListControl.
	/// </summary>
	public class DefaultPermissionListControl : BaseBlogPermissionsGridControl
	{
		protected ComponentArt.Web.UI.Grid Grid1;

		#region Child Controls

		protected ResourceLinkButton SaveButton;

		#endregion

		override protected void OnInit(EventArgs e)
		{
			InitializeComponent();
			base.OnInit(e);
			this.SaveButton.Click +=new EventHandler(SaveButton_Click);
		}

		private void Page_Load(object sender, EventArgs e)
		{
		}


		protected override bool CreateFromDefault(PermissionBase permission)
		{
			return false;
		}

		protected override bool IsNew(PermissionBase permission)
		{
			return permission == null;
		}

		private void InitializeComponent()
		{
			this.Load += new EventHandler(this.Page_Load);
		}

		private void SaveButton_Click(object sender, EventArgs e)
		{
			base.Save();
			Weblogs.ResetWeblogCache();
			Response.Redirect(Request.RawUrl);
		}

	}
}
